home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / ATT.ZIP / LOCATION.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-04-16  |  20.9 KB  |  719 lines

  1. VERSION 2.00
  2. Begin Form LocationForm 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Same Sun Rise & Set & Shine"
  6.    ClientHeight    =   6510
  7.    ClientLeft      =   2070
  8.    ClientTop       =   480
  9.    ClientWidth     =   5025
  10.    ClipControls    =   0   'False
  11.    ControlBox      =   0   'False
  12.    Height          =   6945
  13.    Icon            =   LOCATION.FRX:0000
  14.    Left            =   1995
  15.    LinkTopic       =   "Form2"
  16.    ScaleHeight     =   6510
  17.    ScaleWidth      =   5025
  18.    Top             =   120
  19.    Width           =   5175
  20.    Begin SSFrame Frame3D1 
  21.       ForeColor       =   &H00000000&
  22.       Height          =   420
  23.       Index           =   6
  24.       Left            =   1440
  25.       TabIndex        =   26
  26.       Top             =   4920
  27.       Width           =   975
  28.       Begin TextBox tbNow 
  29.          Alignment       =   2  'Center
  30.          BackColor       =   &H00C0C0C0&
  31.          BorderStyle     =   0  'None
  32.          Height          =   210
  33.          Left            =   30
  34.          MaxLength       =   9
  35.          MultiLine       =   -1  'True
  36.          TabIndex        =   27
  37.          Tag             =   "h"
  38.          Text            =   "09/17/95"
  39.          Top             =   150
  40.          Width           =   915
  41.       End
  42.    End
  43.    Begin SSCheck DST 
  44.       Caption         =   "Daylight Savings Time"
  45.       Height          =   255
  46.       Left            =   720
  47.       TabIndex        =   25
  48.       Top             =   4650
  49.       Width           =   3135
  50.    End
  51.    Begin ComboBox TZList 
  52.       Height          =   300
  53.       Left            =   720
  54.       Style           =   2  'Dropdown List
  55.       TabIndex        =   24
  56.       Top             =   3870
  57.       Width           =   3615
  58.    End
  59.    Begin SSFrame Frame3D1 
  60.       ForeColor       =   &H00000000&
  61.       Height          =   420
  62.       Index           =   5
  63.       Left            =   3840
  64.       TabIndex        =   18
  65.       Top             =   3090
  66.       Width           =   495
  67.       Begin TextBox LatDir 
  68.          Alignment       =   1  'Right Justify
  69.          BackColor       =   &H00C0C0C0&
  70.          BorderStyle     =   0  'None
  71.          Height          =   210
  72.          Left            =   36
  73.          MaxLength       =   1
  74.          MultiLine       =   -1  'True
  75.          TabIndex        =   6
  76.          Tag             =   "h"
  77.          Text            =   "99"
  78.          Top             =   150
  79.          Width           =   405
  80.       End
  81.    End
  82.    Begin SSFrame Frame3D1 
  83.       ForeColor       =   &H00000000&
  84.       Height          =   420
  85.       Index           =   4
  86.       Left            =   2880
  87.       TabIndex        =   17
  88.       Top             =   3090
  89.       Width           =   495
  90.       Begin TextBox LatSec 
  91.          Alignment       =   1  'Right Justify
  92.          BackColor       =   &H00C0C0C0&
  93.          BorderStyle     =   0  'None
  94.          Height          =   210
  95.          Left            =   36
  96.          MaxLength       =   2
  97.          MultiLine       =   -1  'True
  98.          TabIndex        =   5
  99.          Tag             =   "h"
  100.          Text            =   "99"
  101.          Top             =   150
  102.          Width           =   405
  103.       End
  104.    End
  105.    Begin SSFrame Frame3D1 
  106.       ForeColor       =   &H00000000&
  107.       Height          =   420
  108.       Index           =   3
  109.       Left            =   1920
  110.       TabIndex        =   16
  111.       Top             =   3090
  112.       Width           =   495
  113.       Begin TextBox LatDeg 
  114.          Alignment       =   1  'Right Justify
  115.          BackColor       =   &H00C0C0C0&
  116.          BorderStyle     =   0  'None
  117.          Height          =   210
  118.          Left            =   36
  119.          MaxLength       =   2
  120.          MultiLine       =   -1  'True
  121.          TabIndex        =   4
  122.          Tag             =   "h"
  123.          Text            =   "99"
  124.          Top             =   150
  125.          Width           =   405
  126.       End
  127.    End
  128.    Begin SSFrame Frame3D1 
  129.       ForeColor       =   &H00000000&
  130.       Height          =   420
  131.       Index           =   2
  132.       Left            =   3840
  133.       TabIndex        =   15
  134.       Top             =   2670
  135.       Width           =   495
  136.       Begin TextBox LongDir 
  137.          Alignment       =   1  'Right Justify
  138.          BackColor       =   &H00C0C0C0&
  139.          BorderStyle     =   0  'None
  140.          Height          =   210
  141.          Left            =   36
  142.          MaxLength       =   1
  143.          MultiLine       =   -1  'True
  144.          TabIndex        =   3
  145.          Tag             =   "h"
  146.          Text            =   "99"
  147.          Top             =   150
  148.          Width           =   405
  149.       End
  150.    End
  151.    Begin SSFrame Frame3D1 
  152.       ForeColor       =   &H00000000&
  153.       Height          =   420
  154.       Index           =   1
  155.       Left            =   2880
  156.       TabIndex        =   14
  157.       Top             =   2670
  158.       Width           =   495
  159.       Begin TextBox LongSec 
  160.          Alignment       =   1  'Right Justify
  161.          BackColor       =   &H00C0C0C0&
  162.          BorderStyle     =   0  'None
  163.          Height          =   210
  164.          Left            =   36
  165.          MaxLength       =   2
  166.          MultiLine       =   -1  'True
  167.          TabIndex        =   2
  168.          Tag             =   "h"
  169.          Text            =   "99"
  170.          Top             =   150
  171.          Width           =   405
  172.       End
  173.    End
  174.    Begin SSFrame Frame3D1 
  175.       ForeColor       =   &H00000000&
  176.       Height          =   420
  177.       Index           =   0
  178.       Left            =   1920
  179.       TabIndex        =   13
  180.       Top             =   2670
  181.       Width           =   495
  182.       Begin TextBox LongDeg 
  183.          Alignment       =   1  'Right Justify
  184.          BackColor       =   &H00C0C0C0&
  185.          BorderStyle     =   0  'None
  186.          Height          =   210
  187.          Left            =   45
  188.          MaxLength       =   3
  189.          MultiLine       =   -1  'True
  190.          TabIndex        =   1
  191.          Tag             =   "h"
  192.          Text            =   "99"
  193.          Top             =   150
  194.          Width           =   405
  195.       End
  196.    End
  197.    Begin ComboBox CityList 
  198.       BackColor       =   &H00C0C0C0&
  199.       ForeColor       =   &H00000000&
  200.       Height          =   2445
  201.       Left            =   720
  202.       Style           =   1  'Simple Combo
  203.       TabIndex        =   0
  204.       Top             =   210
  205.       Width           =   3615
  206.    End
  207.    Begin CommandButton Command1 
  208.       Caption         =   "OK"
  209.       Default         =   -1  'True
  210.       Height          =   330
  211.       Left            =   1200
  212.       TabIndex        =   8
  213.       Top             =   5970
  214.       Width           =   1170
  215.    End
  216.    Begin CommandButton Command3 
  217.       Cancel          =   -1  'True
  218.       Caption         =   "Cancel"
  219.       Height          =   330
  220.       Left            =   2700
  221.       TabIndex        =   9
  222.       Top             =   5970
  223.       Width           =   1170
  224.    End
  225.    Begin SSCheck DSTAuto 
  226.       Caption         =   "Daylight Savings Auto Adjustment"
  227.       Height          =   255
  228.       Left            =   720
  229.       TabIndex        =   7
  230.       Top             =   4290
  231.       Width           =   3135
  232.    End
  233.    Begin Label Label1 
  234.       BackColor       =   &H00C0C0C0&
  235.       Caption         =   "Date"
  236.       ForeColor       =   &H00000000&
  237.       Height          =   255
  238.       Index           =   7
  239.       Left            =   720
  240.       TabIndex        =   28
  241.       Top             =   5070
  242.       Width           =   495
  243.    End
  244.    Begin Label Label1 
  245.       BackColor       =   &H00C0C0C0&
  246.       Caption         =   "'"
  247.       FontBold        =   0   'False
  248.       FontItalic      =   0   'False
  249.       FontName        =   "MS Sans Serif"
  250.       FontSize        =   8.25
  251.       FontStrikethru  =   0   'False
  252.       FontUnderline   =   0   'False
  253.       ForeColor       =   &H00000000&
  254.       Height          =   255
  255.       Index           =   6
  256.       Left            =   3420
  257.       TabIndex        =   23
  258.       Top             =   3210
  259.       Width           =   120
  260.    End
  261.    Begin Label Label1 
  262.       BackColor       =   &H00C0C0C0&
  263.       Caption         =   "'"
  264.       FontBold        =   0   'False
  265.       FontItalic      =   0   'False
  266.       FontName        =   "MS Sans Serif"
  267.       FontSize        =   8.25
  268.       FontStrikethru  =   0   'False
  269.       FontUnderline   =   0   'False
  270.       ForeColor       =   &H00000000&
  271.       Height          =   255
  272.       Index           =   5
  273.       Left            =   3420
  274.       TabIndex        =   22
  275.       Top             =   2820
  276.       Width           =   120
  277.    End
  278.    Begin Label Label1 
  279.       BackColor       =   &H00C0C0C0&
  280.       Caption         =   "
  281.       FontBold        =   0   'False
  282.       FontItalic      =   0   'False
  283.       FontName        =   "MS Sans Serif"
  284.       FontSize        =   8.25
  285.       FontStrikethru  =   0   'False
  286.       FontUnderline   =   0   'False
  287.       ForeColor       =   &H00000000&
  288.       Height          =   255
  289.       Index           =   4
  290.       Left            =   2460
  291.       TabIndex        =   21
  292.       Top             =   3210
  293.       Width           =   120
  294.    End
  295.    Begin Label Label1 
  296.       BackColor       =   &H00C0C0C0&
  297.       Caption         =   "
  298.       FontBold        =   0   'False
  299.       FontItalic      =   0   'False
  300.       FontName        =   "MS Sans Serif"
  301.       FontSize        =   8.25
  302.       FontStrikethru  =   0   'False
  303.       FontUnderline   =   0   'False
  304.       ForeColor       =   &H00000000&
  305.       Height          =   255
  306.       Index           =   3
  307.       Left            =   2460
  308.       TabIndex        =   20
  309.       Top             =   2820
  310.       Width           =   120
  311.    End
  312.    Begin Label SunriseSunset 
  313.       Alignment       =   2  'Center
  314.       BackColor       =   &H00C0C0C0&
  315.       Caption         =   "Sunrise: 4:14am Sunset: 6:55p"
  316.       FontBold        =   0   'False
  317.       FontItalic      =   0   'False
  318.       FontName        =   "MS Sans Serif"
  319.       FontSize        =   8.25
  320.       FontStrikethru  =   0   'False
  321.       FontUnderline   =   0   'False
  322.       ForeColor       =   &H00000000&
  323.       Height          =   255
  324.       Left            =   720
  325.       TabIndex        =   19
  326.       Top             =   5490
  327.       Width           =   3615
  328.    End
  329.    Begin Label Label1 
  330.       BackColor       =   &H00C0C0C0&
  331.       Caption         =   "Time Zone"
  332.       ForeColor       =   &H00000000&
  333.       Height          =   255
  334.       Index           =   2
  335.       Left            =   720
  336.       TabIndex        =   12
  337.       Top             =   3660
  338.       Width           =   975
  339.    End
  340.    Begin Label Label1 
  341.       BackColor       =   &H00C0C0C0&
  342.       Caption         =   "Latitude"
  343.       ForeColor       =   &H00000000&
  344.       Height          =   255
  345.       Index           =   1
  346.       Left            =   720
  347.       TabIndex        =   11
  348.       Top             =   3240
  349.       Width           =   975
  350.    End
  351.    Begin Label Label1 
  352.       BackColor       =   &H00C0C0C0&
  353.       Caption         =   "Longitude"
  354.       ForeColor       =   &H00000000&
  355.       Height          =   255
  356.       Index           =   0
  357.       Left            =   720
  358.       TabIndex        =   10
  359.       Top             =   2820
  360.       Width           =   975
  361.    End
  362. Option Explicit
  363. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  364. Declare Function GetWindow Lib "User" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer
  365. Dim LocationLines%
  366. Dim locationdetails$()
  367. Dim LocationNames$()
  368. Dim SettingCity%
  369. Dim SettingText%
  370. Dim tNow
  371. Sub Calc ()
  372. Dim LongMinus$, LatMinus$
  373. Dim T$, Start%
  374. Dim SunRise$
  375. Dim Sunset$
  376. T$ = TZList.Text
  377. T$ = Trim$(Mid$(T$, InStr(T$, ")") + 1, 200))
  378. Start = InStr(T$, ":")
  379. If Start > 0 Then
  380.   Mid(T$, Start, 1) = "."
  381. End If
  382. If LongDir.Text = "E" Then LongMinus$ = "-" Else LongMinus$ = ""
  383. If LatDir.Text = "S" Then LatMinus$ = "-" Else LatMinus$ = ""
  384. Call CalcSunRiseSet(LongMinus$ + LongDeg.Text + "." + LongSec.Text, LatMinus$ + LatDeg.Text + "." + LatSec.Text, Val(T$), (DST.Value), tNow, SunRise$, Sunset$)
  385. SunRiseSunSet.Caption = "Sunrise: " + SunRise$ + "  Sunset: " + Sunset$
  386. End Sub
  387. Sub City_Change ()
  388. 'If SettingCity% Then Exit Sub
  389. 'Dim I%
  390. 'Dim SavedPos%
  391. 'If Left$(LocationNames$(CityList.ListIndex + 1), Len(City.Text)) = City.Text Then
  392.    'I% = CityList.ListIndex + 1
  393. 'Else
  394.    'MousePointer = 11
  395.    'I% = 1
  396. 'End If
  397. 'While I% <= LocationLines%
  398.    'If Left$(LocationNames$(I%), Len(City.Text)) = City.Text Then
  399.       'SettingCity% = True
  400.       'SavedPos% = City.SelStart
  401.       'CityList.ListIndex = I% - 1
  402.       'City.Text = CityList.List(CityList.ListIndex)
  403.       'DoEvents
  404.       'City.SelStart = SavedPos
  405.       'City.SelLength = 30000
  406.       'SettingCity% = False
  407.       'MousePointer = 0
  408.       'Exit Sub
  409.    'End If
  410. 'I% = I% + 1
  411. 'Wend
  412. 'MousePointer = 0
  413. End Sub
  414. Sub City_GotFocus ()
  415. 'City.SelStart = 0
  416. 'City.SelLength = 3000
  417. End Sub
  418. Sub City_KeyPress (KeyAscii As Integer)
  419. 'If KeyAscii = 8 Then
  420.    'City.SelStart = City.SelStart - 1
  421.    'City.SelLength = 30000
  422.    'DoEvents
  423.    'City.SelText = ""
  424. 'End If
  425. End Sub
  426. Sub CityList_Click ()
  427.    'City.Text = CityList.List(CityList.ListIndex)
  428. Dim T$, I%
  429. T$ = locationdetails(CityList.ListIndex + 1)
  430. '123456789012345678901234567890
  431. 'N61 10 W149 59 HST Y  AK
  432. SettingText = True
  433. If Mid$(T$, 20, 1) = "Y" Then
  434.    DSTAuto.Value = True
  435.    DSTAuto.Value = False
  436. End If
  437. LatDir.Text = Mid$(T$, 1, 1)
  438. Call LatDir_GotFocus
  439. LatDeg.Text = Mid$(T$, 2, 2)
  440. Call LatDeg_GotFocus
  441. LatSec.Text = Mid$(T$, 5, 2)
  442. Call LatSec_GotFocus
  443. LongDir.Text = Mid$(T$, 8, 1)
  444. Call LongDir_GotFocus
  445. LongDeg.Text = Mid$(T$, 9, 3)
  446. Call LongDeg_GotFocus
  447. LongSec.Text = Mid$(T$, 13, 2)
  448. Call LongSec_GotFocus
  449. 'TimeZone.Text = Mid$(T$, 16, 3)
  450. TZList.ListIndex = -1
  451. For I% = 1 To TZs%
  452.   If InStr(TZ(I%), "(" + Mid$(T$, 16, 3) + ")") <> 0 Then TZList.ListIndex = I% - 1
  453. Next I%
  454. 'Call TimeZone_GotFocus
  455. SettingText = False
  456. Call Calc
  457. End Sub
  458. Sub CityList_LostFocus ()
  459. Const WM_USER = &H400
  460. Const LB_GETTOPINDEX = (WM_USER + 15)
  461. Const GW_CHILD = 5
  462. Const GW_HWNDNEXT = 2
  463. Dim T$
  464. Dim TopIndex&
  465. Dim TempWin%
  466. 'Declare Function GetWindow Lib "User" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer
  467. TempWin = GetWindow(CityList.hWnd, GW_CHILD)
  468. TopIndex& = SendMessage(TempWin, LB_GETTOPINDEX, 0, 0&)
  469. 'TempWin = GetWindow(TempWin, GW_HWNDNEXT)
  470. 'TopIndex& = SendMessage(TempWin, LB_GETTOPINDEX, 0, 0&)
  471. '!!!!!
  472. 'GetWIndow (GW_CHILD)
  473. 'GetWindow(HWNDNEXT)
  474. T$ = CityList.List(TopIndex&)
  475. If UCase$(Left$(T$, Len(CityList.Text))) = UCase$(CityList.Text) Then
  476.    CityList.ListIndex = TopIndex
  477. End If
  478. End Sub
  479. Sub Command1_Click ()
  480. Dim T$
  481. Call CityList_LostFocus
  482. gLocation = CityList.Text
  483. gLongitude = LongDeg.Text + "." + LongSec.Text + LongDir.Text
  484. gLatitude = LatDeg.Text + "." + LatSec.Text + LatDir.Text
  485. gDST = DST.Value
  486. gDSTAuto = DSTAuto.Value
  487. T$ = TZList.Text
  488. gTimeZOne = Trim$(Mid$(T$, InStr(T$, "(") + 1, 3))
  489. oldDate = -1
  490. Unload Me
  491. End Sub
  492. Sub Command3_Click ()
  493. Unload Me
  494. End Sub
  495. Sub DST_Click (Value As Integer)
  496. If SettingText Then Exit Sub
  497. Call Calc
  498. End Sub
  499. Sub DSTAuto_Click (Value As Integer)
  500. If Value Then
  501.    DST.Enabled = False
  502.    Call SetDST
  503.    DST.Enabled = True
  504. End If
  505. If SettingText Then Exit Sub
  506. Call Calc
  507. End Sub
  508. Sub Form_Load ()
  509. Dim GotIt%
  510. Dim I%
  511. Dim PPos%, T$
  512. Dim K%
  513. Screen.MousePointer = 11
  514. Me.Left = (Screen.Width - Me.Width) / 2
  515. Me.Top = (Screen.Height - Me.Height) / 2
  516. SettingText = True
  517. tbNow.Text = Format$(Now, "Short Date")
  518. CalcDSTStartStop (tbNow.Text)
  519. If TZs% = 0 Then Call InitTimeZoneStuff
  520. T$ = "(" + gTimeZOne + ")"
  521. For I% = 1 To TZs%
  522.   If TZ$(I%) <> "" Then TZList.AddItem TZ$(I%)
  523.   If InStr(TZ$(I%), T$) Then K% = I% - 1
  524. Next I%
  525. TZList.ListIndex = K%
  526. GotIt% = 0
  527. Dim LocationLine$
  528. Dim CITY$, State$
  529. Dim CityState$
  530. Dim Slash$
  531. On Local Error Resume Next
  532. Slash$ = App.Path
  533. If Right$(Slash$, 1) <> "\" Then Slash$ = Slash$ + "\"
  534. Open Slash$ + "CITIES.TXT" For Input As 1
  535. If Err <> 0 Then
  536.    Screen.MousePointer = 0
  537.    MsgBox "CITIES.TXT could not be opened."
  538.    Unload Me
  539.    Exit Sub
  540. End If
  541. On Local Error GoTo 0
  542. LocationLines% = 0
  543. While Not EOF(1)
  544.   Line Input #1, LocationLine$
  545.   If Left$(LocationLine$, 1) <> "*" Then
  546.      LocationLines% = LocationLines% + 1
  547.      ReDim Preserve locationdetails$(LocationLines%)
  548.      ReDim Preserve LocationNames$(LocationLines%)
  549.      CITY$ = ""
  550.      State$ = ""
  551.      I% = InStr(1, LocationLine$, Chr$(9))
  552.      If I% > 0 Then
  553.     CITY$ = Left$(LocationLine$, I% - 1)
  554.     LocationLine$ = Mid$(LocationLine$, I% + 1, 30000)
  555.      End If
  556.      
  557.      I% = InStr(1, LocationLine$, Chr$(9))
  558.      If I% > 0 Then
  559.     State$ = Left$(LocationLine$, I% - 1)
  560.     LocationLine$ = Mid$(LocationLine$, I% + 1, 30000)
  561.      End If
  562.      CITY$ = Trim$(CITY$)
  563.      State$ = Trim$(State$)
  564.      If State$ <> "" Then
  565.     CityState$ = CITY$ + ", " + State$
  566.      Else
  567.     CityState$ = CITY$
  568.      End If
  569.      CityList.AddItem CityState$
  570.      If CityState$ = gLocation Then GotIt% = CityList.ListCount
  571.      LocationNames$(LocationLines%) = CityState$
  572.      locationdetails$(LocationLines%) = LocationLine$
  573.   End If
  574. Close 1
  575. Screen.MousePointer = 0
  576. PPos% = InStr(gLongitude, ".")
  577. LongDeg.Text = Left$(gLongitude, PPos% - 1)
  578. T$ = Mid$(gLongitude, PPos% + 1, 255)
  579. LongSec.Text = Left$(T$, Len(T$) - 1)
  580. LongDir.Text = Right$(T$, 1)
  581. PPos% = InStr(gLatitude, ".")
  582. LatDeg.Text = Left$(gLatitude, PPos% - 1)
  583. T$ = Mid$(gLatitude, PPos% + 1, 255)
  584. LatSec.Text = Left$(T$, Len(T$) - 1)
  585. LatDir.Text = Right$(T$, 1)
  586. CityList.Text = gLocation
  587. DST.Value = gDST
  588. DSTAuto.Value = gDSTAuto
  589. T$ = "(" + gTimeZOne + ")"
  590. 'time zone
  591. 'dst auto
  592. SettingText = False
  593. If GotIt% Then
  594.    CityList.ListIndex = GotIt% - 1
  595.    Call Calc
  596. End If
  597. 'CityList.Text = "New York City, New York"
  598. End Sub
  599. Sub LatDeg_Change ()
  600. If SettingText Then Exit Sub
  601. Call Calc
  602. End Sub
  603. Sub LatDeg_GotFocus ()
  604. LatDeg.SelStart = 0
  605. LatDeg.SelLength = 30000
  606. End Sub
  607. Sub LatDeg_KeyPress (KeyAscii As Integer)
  608. If KeyAscii >= 32 Then
  609.    KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  610.    If (KeyAscii < Asc("0")) Or (KeyAscii > Asc("9")) Then KeyAscii = 0
  611. End If
  612. End Sub
  613. Sub LatDir_Change ()
  614. If SettingText Then Exit Sub
  615. Call Calc
  616. End Sub
  617. Sub LatDir_GotFocus ()
  618. LatDir.SelStart = 0
  619. LatDir.SelLength = 30000
  620. End Sub
  621. Sub LatDir_KeyPress (KeyAscii As Integer)
  622. KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  623. If (KeyAscii <> Asc("N")) And (KeyAscii <> Asc("S")) Then KeyAscii = 0
  624. End Sub
  625. Sub LatSec_Change ()
  626. If SettingText Then Exit Sub
  627. Call Calc
  628. End Sub
  629. Sub LatSec_GotFocus ()
  630. LatSec.SelStart = 0
  631. LatSec.SelLength = 30000
  632. End Sub
  633. Sub LatSec_KeyPress (KeyAscii As Integer)
  634. If KeyAscii >= 32 Then
  635.    KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  636.    If (KeyAscii < Asc("0")) Or (KeyAscii > Asc("9")) Then KeyAscii = 0
  637. End If
  638. End Sub
  639. Sub LongDeg_Change ()
  640. If SettingText Then Exit Sub
  641. Call Calc
  642. End Sub
  643. Sub LongDeg_GotFocus ()
  644. LongDeg.SelStart = 0
  645. LongDeg.SelLength = 30000
  646. End Sub
  647. Sub LongDeg_KeyPress (KeyAscii As Integer)
  648. If KeyAscii >= 32 Then
  649.    KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  650.    If (KeyAscii < Asc("0")) Or (KeyAscii > Asc("9")) Then KeyAscii = 0
  651. End If
  652. End Sub
  653. Sub LongDir_Change ()
  654. If SettingText Then Exit Sub
  655. Call Calc
  656. End Sub
  657. Sub LongDir_GotFocus ()
  658. LongDir.SelStart = 0
  659. LongDir.SelLength = 30000
  660. End Sub
  661. Sub LongDir_KeyPress (KeyAscii As Integer)
  662. KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  663. If (KeyAscii <> Asc("E")) And (KeyAscii <> Asc("W")) Then KeyAscii = 0
  664. End Sub
  665. Sub LongSec_Change ()
  666. If SettingText Then Exit Sub
  667. Call Calc
  668. End Sub
  669. Sub LongSec_GotFocus ()
  670. LongSec.SelStart = 0
  671. LongSec.SelLength = 30000
  672. End Sub
  673. Sub LongSec_KeyPress (KeyAscii As Integer)
  674. If KeyAscii >= 32 Then
  675.    KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  676.    If (KeyAscii < Asc("0")) Or (KeyAscii > Asc("9")) Then KeyAscii = 0
  677. End If
  678. End Sub
  679. Sub SetDST ()
  680. Dim tSettingText
  681. tSettingText = SettingText
  682. SettingText = True
  683.    If (tNow >= DSTStart) And (tNow < DSTStop) Then
  684.       DST.Value = True
  685.    Else
  686.       DST.Value = False
  687.    End If
  688. SettingText = tSettingText
  689. End Sub
  690. Sub tbNow_Change ()
  691. On Local Error Resume Next
  692. tNow = DateValue(Format$(tbNow.Text, "Short Date"))
  693. If DSTAuto.Value Then Call SetDST
  694. If SettingText Then Exit Sub
  695. If tbNow.Text = "" Then Exit Sub
  696. Call Calc
  697. End Sub
  698. Sub tbNow_GotFocus ()
  699. tbNow.SelStart = 0
  700. tbNow.SelLength = 30000
  701. End Sub
  702. Sub tbNow_KeyPress (KeyAscii As Integer)
  703. KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  704. If KeyAscii >= 32 Then
  705.    If (KeyAscii <> Asc("/")) And (KeyAscii <> Asc("-") And ((KeyAscii < Asc("0")) Or (KeyAscii > Asc("9")))) Then KeyAscii = 0
  706. End If
  707. End Sub
  708. Sub tbNow_LostFocus ()
  709. tbNow.Text = Format$(tbNow.Text, "Short Date")
  710. End Sub
  711. Sub TimeZone_GotFocus ()
  712. 'TimeZone.SelStart = 0
  713. 'TimeZone.SelLength = 30000
  714. End Sub
  715. Sub TZList_Click ()
  716. If SettingText Then Exit Sub
  717. Call Calc
  718. End Sub
  719.